package com.movile.checkhoras.android.adapter;

import java.util.List;

import com.movile.checkhoras.android.R;
import com.movile.checkhoras.android.vo.MesAno;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MesAnoAdapter extends BaseAdapter {
	
	private List<MesAno> lista;
	private Context context;
	
	public MesAnoAdapter(Context ctx,  List<MesAno> lista){
		this.lista = lista;
		this.context = ctx;
	}
	
	

	@Override
	public int getCount() {
		
		return lista.size();
	}

	@Override
	public MesAno getItem(int arg0) {
		
		return lista.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		
		MesAno mesAno = lista.get(arg0);
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View v = inflater.inflate(R.layout.itemmesano, null);				
		
		TextView txtTitulo = (TextView) v.findViewById(R.id.txtMes);
		txtTitulo.setText(mesAno.getNameMouth());
		
		
		TextView txtDesc = (TextView) v.findViewById(R.id.txtAno);
		txtDesc.setText(mesAno.getAno());				
		
		return v;
	}

}
